#ifndef MYPIXMAPITEM_H
#define MYPIXMAPITEM_H
#include <QObject>
#include <QWidget>
#include<QGraphicsItem>
#include<QPainter>
#include<QTimer>

class MyPixMapItem : public QObject, public QGraphicsItem
{
    Q_OBJECT
    Q_INTERFACES(QGraphicsItem)

public:
    MyPixMapItem(QObject *parent = 0);
    MyPixMapItem(QString filename,QGraphicsItem *parent=0);
    QRectF boundingRect() const;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
    void setXrate(float xrate);
    void setXrate_ltr(float xrate);
    void setYrate(float yrate);
    void setPixmap(QString filename);
    void setXEn(bool xen);
    void setYEn(bool yen);
signals:
    void clicked();
protected:
    void mousePressEvent(QGraphicsSceneMouseEvent *event);
    void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
    void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);

public:
    QPixmap pix;
    QPixmap outpix;
private:
    bool En_X;
    bool En_Y;


};
#endif // MYPIXMAPITEM_H
